<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ include file="/jsplib/pubhead.jsp"%>
<%@ page import="net.comm.common.ValueMaping" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>社区首页：i友邻社区</title>
	<link href="${cpath}/css/youlin.css" rel="stylesheet" type="text/css" media="all" />
	<!--[if IE 6]>
	  <script type="text/javascript" src="js/DD_belatedPNG_0.0.8a-min.js"></script>
	  <script type="text/javascript" src="js/ie6-png.js"></script>
	<![endif]-->
</head>
<body>
<!--外套 start -->
<div class="wrap">
  <!--页首 start -->
	<%@ include file="/menu.jsp"%>
  <!--页首 end -->  
  
  <!--导航面包屑 start -->
  <div class="breadCrumb">
  <div class="breadCrumbNav">当前位置：<a href="${cpath}/users.do?action=main">我的主页</a> >> <a > 社区广场</a></div>
 </div> 
  <!--导航面包屑 end -->
    
  
  <!--主体 start -->
 <div class="body theBody-community">
    <div class="hotBox1" >  
        <div class="hotBox1-left">
             <div class="hotBox1-buluo" >  
              <img src="${cpath}/images/img5.jpg" width="102" height="75" class="shequ icon user_icon_2" /> 
			  <p><b>${theForm.village}小区</b></p>
              <p>成员：${theForm.memberNum}人  
              <p>社区地址：${myfn:getCnpcaName(theForm.work_sublocation)}  ${myfn:getCnpcaName(theForm.work_area)}</p>	
            </div>
        </div>
    </div>

   <div class="leftBar">
      <div class="thebox1" >
       <h3>社区地图</h3>
       <div class="content">
       <!--这里可以根据实际需要 变更框大小及位置 <img src="${cpath}/images/img20.png" width="212" height="170" /> -->
		 <c:if test="${theForm.mapXY != ''}">
			<img id="mappic" src="http://maps.google.com/maps/api/staticmap?markers=color:red|color:red|${theForm.mapXY}&zoom=14&size=212x170&sensor=false" />	
		 </c:if>       
		<div class="clearFloat"></div>      
       </div>
      </div>
      
       <div class="thebox1">
       <h3>常设机构</h3>
       <div class="content content-jg">
         <a href="${cpath}/yewei.do?action=home&villageID=${theForm.villageID}"><img src="${cpath}/images/icon_14.gif" width="137" height="43" /></a>
         <br /><br />
         <a href="${cpath}/wuye.do?action=home&villageID=${theForm.villageID}"><img src="${cpath}/images/icon_15.gif" width="138" height="44" /></a>
       </div>
      </div>
      <div class="thebox1">
        <h3>社区资料</h3>
       <div class="content content-sq">
       <ul>
		<c:set value="0" var="zishu"/>
		<li style="line-height:25px;">
		<c:forEach var="ziliao" items="${ziliaolist}" varStatus="status"> 
		<c:if test="${ zishu < 80 }">
			<a href="${cpath}/gfollforum_list/qryGForumID_${ziliao.GForumID}.html">${ziliao.title}</a>&nbsp;
			<c:set value="${fn:length(ziliao.title) + zishu}" var="zishu"/>
		</c:if>
		</c:forEach> 
		<a href="${cpath}/gforum.do?action=zladdPage&groupID=99999999&villageID=${theForm.villageID}&firsort=1">[新增]</a>
		</li>
<!--	<c:set value="no" var="zlexist"/>
	<li>
	<c:forEach var="ziliao" items="${ziliaolist}" varStatus="status"> 
	<c:if test="${ 1 == ziliao.firsort}">
	<span class="s1"><a href="${cpath}/gforum.do?action=zllist&qryVillageID=${theForm.villageID}&qryFirsort=1">购物</a>&nbsp;&nbsp;<a title="${ziliao.title}" href="${cpath}/gfollforum_list/qryGForumID_${ziliao.GForumID}.html">${fn:substring(ziliao.title,0,8)}</a></span>
	<span ><a href="${cpath}/gforum.do?action=zlmodifyPage&GForumID=${ziliao.GForumID}">[编辑]</a></span>
	<c:set value="yes" var="zlexist"/>
	</c:if>
	</c:forEach> 
	<c:if test="${ 'no' == zlexist}">
	<span class="s1"><a href="${cpath}/gforum.do?action=zllist&qryVillageID=${theForm.villageID}&qryFirsort=1">购物</a></span><span >
	<a href="${cpath}/gforum.do?action=zladdPage&groupID=99999999&villageID=${theForm.villageID}&firsort=1">[新增]</a></span>
	</c:if>
	</li>
	
	<c:set value="no" var="zlexist"/>
	<li>
	<c:forEach var="ziliao" items="${ziliaolist}" varStatus="status"> 
	<c:if test="${ 4 == ziliao.firsort}">
	<span class="s1"><a href="${cpath}/gforum.do?action=zllist&qryVillageID=${theForm.villageID}&qryFirsort=4">交通</a>&nbsp;&nbsp;<a  title="${ziliao.title}" href="${cpath}/gfollforum_list/qryGForumID_${ziliao.GForumID}.html">${fn:substring(ziliao.title,0,8)}</a></span>
	<span ><a href="${cpath}/gforum.do?action=zlmodifyPage&GForumID=${ziliao.GForumID}">[编辑]</a></span>
	<c:set value="yes" var="zlexist"/>
	</c:if>
	</c:forEach> 
	<c:if test="${ 'no' == zlexist}">
	<span class="s1"><a href="${cpath}/gforum.do?action=zllist&qryVillageID=${theForm.villageID}&qryFirsort=4">交通</a></span>
	<span >
	<a href="${cpath}/gforum.do?action=zladdPage&groupID=99999999&villageID=${theForm.villageID}&firsort=4">[新增]</a></span>
	</c:if>
	</li>

	<c:set value="no" var="zlexist"/>
	<li>
	<c:forEach var="ziliao" items="${ziliaolist}" varStatus="status"> 
	<c:if test="${ 5 == ziliao.firsort}">
	<span class="s1"><a href="${cpath}/gforum.do?action=zllist&qryVillageID=${theForm.villageID}&qryFirsort=5">旅游</a>&nbsp;&nbsp;<a  title="${ziliao.title}" href="${cpath}/gfollforum_list/qryGForumID_${ziliao.GForumID}.html">${fn:substring(ziliao.title,0,8)}</a></span>
	<span ><a href="${cpath}/gforum.do?action=zlmodifyPage&GForumID=${ziliao.GForumID}">[编辑]</a></span>
	<c:set value="yes" var="zlexist"/>
	</c:if>
	</c:forEach> 
	<c:if test="${ 'no' == zlexist}">
	<span class="s1"><a href="${cpath}/gforum.do?action=zllist&qryVillageID=${theForm.villageID}&qryFirsort=5">旅游</a></span>
	<span >
	<a href="${cpath}/gforum.do?action=zladdPage&groupID=99999999&villageID=${theForm.villageID}&firsort=5">[新增]</a></span>
	</c:if>
	</li>
	
	<c:set value="no" var="zlexist"/>
	<li>
	<c:forEach var="ziliao" items="${ziliaolist}" varStatus="status"> 
	<c:if test="${ 6 == ziliao.firsort}">
	<span class="s1"><a href="${cpath}/gforum.do?action=zllist&qryVillageID=${theForm.villageID}&qryFirsort=6">医疗</a>&nbsp;&nbsp;<a title="${ziliao.title}"  href="${cpath}/gfollforum_list/qryGForumID_${ziliao.GForumID}.html">${fn:substring(ziliao.title,0,8)}</a></span>
	<span ><a href="${cpath}/gforum.do?action=zlmodifyPage&GForumID=${ziliao.GForumID}">[编辑]</a></span>
	<c:set value="yes" var="zlexist"/>
	</c:if>
	</c:forEach> 
	<c:if test="${ 'no' == zlexist}">
	<span class="s1"><a href="${cpath}/gforum.do?action=zllist&qryVillageID=${theForm.villageID}&qryFirsort=6">医疗</a></span>
	<span >
	<a href="${cpath}/gforum.do?action=zladdPage&groupID=99999999&villageID=${theForm.villageID}&firsort=6">[新增]</a></span>
	</c:if>
	</li>
	<c:set value="no" var="zlexist"/>
	<li>
	<c:forEach var="ziliao" items="${ziliaolist}" varStatus="status"> 
	<c:if test="${ 7 == ziliao.firsort}">
	<span class="s1"><a href="${cpath}/gforum.do?action=zllist&qryVillageID=${theForm.villageID}&qryFirsort=7">餐饮</a>&nbsp;&nbsp;<a title="${ziliao.title}"  href="${cpath}/gfollforum_list/qryGForumID_${ziliao.GForumID}.html">${fn:substring(ziliao.title,0,8)}</a></span>
	<span ><a href="${cpath}/gforum.do?action=zlmodifyPage&GForumID=${ziliao.GForumID}">[编辑]</a></span>
	<c:set value="yes" var="zlexist"/>
	</c:if>
	</c:forEach> 
	<c:if test="${ 'no' == zlexist}">
	<span class="s1"><a href="${cpath}/gforum.do?action=zllist&qryVillageID=${theForm.villageID}&qryFirsort=7">餐饮</a></span>
	<span >
	<a href="${cpath}/gforum.do?action=zladdPage&groupID=99999999&villageID=${theForm.villageID}&firsort=7">[新增]</a></span>
	</c:if>
	</li>
	<c:set value="no" var="zlexist"/>
	<li>
	<c:forEach var="ziliao" items="${ziliaolist}" varStatus="status"> 
	<c:if test="${ 8 == ziliao.firsort}">
	<span class="s1"><a href="${cpath}/gforum.do?action=zllist&qryVillageID=${theForm.villageID}&qryFirsort=8">运动</a>&nbsp;&nbsp;<a title="${ziliao.title}"  href="${cpath}/gfollforum_list/qryGForumID_${ziliao.GForumID}.html">${fn:substring(ziliao.title,0,8)}</a></span>
	<span ><a href="${cpath}/gforum.do?action=zlmodifyPage&GForumID=${ziliao.GForumID}">[编辑]</a></span>
	<c:set value="yes" var="zlexist"/>
	</c:if>
	</c:forEach> 
	<c:if test="${ 'no' == zlexist}">
	<span class="s1"><a href="${cpath}/gforum.do?action=zllist&qryVillageID=${theForm.villageID}&qryFirsort=8">运动</a></span>
	<span >
	<a href="${cpath}/gforum.do?action=zladdPage&groupID=99999999&villageID=${theForm.villageID}&firsort=8">[新增]</a></span>
	</c:if>
	</li>
	<c:set value="no" var="zlexist"/>
	<li>
	<c:forEach var="ziliao" items="${ziliaolist}" varStatus="status"> 
	<c:if test="${ 9 == ziliao.firsort}">
	<span class="s1"><a href="${cpath}/gforum.do?action=zllist&qryVillageID=${theForm.villageID}&qryFirsort=9">休闲</a>&nbsp;&nbsp;<a href="${cpath}/gfollforum_list/qryGForumID_${ziliao.GForumID}.html">${fn:substring(ziliao.title,0,8)}</a></span>
	<span class="s3"><a href="${cpath}/gforum.do?action=zlmodifyPage&GForumID=${ziliao.GForumID}">[编辑]</a></span>
	<c:set value="yes" var="zlexist"/>
	</c:if>
	</c:forEach> 
	<c:if test="${ 'no' == zlexist}">
	<span class="s1"><a href="${cpath}/gforum.do?action=zllist&qryVillageID=${theForm.villageID}&qryFirsort=9">休闲</a></span>
	<span>
	<a href="${cpath}/gforum.do?action=zladdPage&groupID=99999999&villageID=${theForm.villageID}&firsort=9">[新增]</a></span>
	</c:if>
	</li>
	<c:set value="no" var="zlexist"/>
	<li>
	<c:forEach var="ziliao" items="${ziliaolist}" varStatus="status"> 
	<c:if test="${ 10 == ziliao.firsort}">
	<span class="s1"><a href="${cpath}/gforum.do?action=zllist&qryVillageID=${theForm.villageID}&qryFirsort=10">通讯</a>&nbsp;&nbsp;<a href="${cpath}/gfollforum_list/qryGForumID_${ziliao.GForumID}.html">${fn:substring(ziliao.title,0,8)}</a></span>
	<span class="s3"><a href="${cpath}/gforum.do?action=zlmodifyPage&GForumID=${ziliao.GForumID}">[编辑]</a></span>
	<c:set value="yes" var="zlexist"/>
	</c:if>
	</c:forEach> 
	<c:if test="${ 'no' == zlexist}">
	<span class="s1"><a href="${cpath}/gforum.do?action=zllist&qryVillageID=${theForm.villageID}&qryFirsort=10">通讯</a></span>
	<span>
	<a href="${cpath}/gforum.do?action=zladdPage&groupID=99999999&villageID=${theForm.villageID}&firsort=10">[新增]</a></span>
	</c:if>
	</li>

	<c:set value="no" var="zlexist"/>
	<li>
	<c:forEach var="ziliao" items="${ziliaolist}" varStatus="status"> 
	<c:if test="${ 11 == ziliao.firsort}">
	<span class="s1"><a href="${cpath}/gforum.do?action=zllist&qryVillageID=${theForm.villageID}&qryFirsort=11">物管</a>&nbsp;&nbsp;<a href="${cpath}/gfollforum_list/qryGForumID_${ziliao.GForumID}.html">${fn:substring(ziliao.title,0,10)}</a></span>
	<span class="s3"><a href="${cpath}/gforum.do?action=zlmodifyPage&GForumID=${ziliao.GForumID}">[编辑]</a></span>
	<c:set value="yes" var="zlexist"/>
	</c:if>
	</c:forEach> 
	<c:if test="${ 'no' == zlexist}"><span class="s2">
	<a href="${cpath}/gforum.do?action=zladdPage&groupID=99999999&villageID=${theForm.villageID}&firsort=11">[新增]</a></span>
	</c:if>
	</li>
-->
         </ul>
       </div>
       <a class="more4" href="${cpath}/gforum.do?action=zllist&qryVillageID=${theForm.villageID}">点击查看更多</a>
      </div>

	<div class="thebox1">
       <h3>留言板</h3>
       <div class="content content-ly">
         <ul class="leaveWord-list1">
			<c:forEach var="liuyan" items="${liuyanlist}" varStatus="status">  			
			<c:if test="${liuyan.follID == 0}">
			  <p id="ly${liuyan.seqID}" title="${liuyan.content}" style="line-height:22px;"><a href="${cpath}/users_home/userID_${liuyan.userID}.html" target="_blank">${myfn:getUserNick(liuyan.userID)}</a>:&nbsp;${fn:substring(liuyan.content,0,11)}</p>
			</c:if>
			<c:if test="${liuyan.follID != 0}">
			  <p class="p3" title="${liuyan.content}" style="line-height:22px;">回复：<a href="${cpath}/users_home/userID_${liuyan.userID}.html" target="_blank">${myfn:getUserNick(liuyan.userID)}</a>: ${fn:substring(liuyan.content,0,11)}<span>${myfn:formatMDHM(liuyan.mtime)}</span></p>
			</c:if>
			</c:forEach>  
			</ul>   
			<form class="leaveWord2" action="${cpath}/notadv.do?action=add" name="form_liuyan" id="form_liuyan"  method="post" enctype="multipart/form-data" >
				<p><textarea name="content" cols="" rows="" style="width:210px; height:50px;"></textarea></p>
				<p>
				<a href="javascript:addliuyan('form_liuyan');" class="btn_r">保  存</a>
				</p>
				<!--隐藏域-->
				<input type="hidden" name='userID'	value='${userID}'/>
				<input type="hidden" name='nsort'	value='6'/>
				<input type="hidden" name='nsortID' value='${theForm.villageID}'/>
				<input type="hidden" name='ntype'	value='5'/>
				<input type="hidden" name='seqID'	value=''/>
				<input type="hidden" name='title'	value='${username}的留言'/>
			</form>
       </div>   
      </div>
      
   </div>
   
   <div class="mainBar">
     <div class="thebox4">
      <h3>社区简介</h3>
      <div class="content">
		${fn:substring(theForm.info,0,200)}&nbsp;&nbsp;
		<a href="${cpath}/shequ.do?action=modifyPage&villageID=${theForm.villageID}">[编辑] </a>      
      </div>
     </div>

     <div class="thebox5">
     <h3>社区成员</h3>
     <a class="more6" href="${cpath}/userhome.do?action=list&qryVillageID=${theForm.villageID}">+更多</a>
      <div class="content content-sq-user2">     
      <!--每栋显示一个UL 循环显示，每个UL一个LI显示第几栋，　整个页面控制输出１４个LI内　即将最多显示两行 -->
        <c:set value='0' var="bd"/>
		<ul>
		  <c:forEach var="member" items="${memberlist}" varStatus="status">  
			<c:if test="${member.building != bd || bd == ''}">
				<li><p class="dong"><span>${member.building}</span>栋</p></li>			
				<c:set value="${member.building}" var="bd"/>
			</c:if>		 
			<li>
			  <p>
			  <a class="pic2" href="${cpath}/users_home/userID_${member.userID}.html" target="_blank"><b></b><img src="${cpath}/${myfn:getUserPic(member.userID)}"  width="48" height="48" border="0"/></a>
			  </p>
			  <p>${myfn:getUserNick(member.userID)}</p>
			  <p class="color_grey1">${member.building}栋${member.houseNo}号</p>
			</li>
		  </c:forEach>
        </ul>                 
      </div> 
     </div>

	<div class="thebox5">
     <h3>社区部落</h3>
     <a class="more6" href="${cpath}/group.do?action=adlist&qryVillageID=${theForm.villageID}&qryFirs=1">+更多</a>
      <div class="content content-sq-user">
          <ul>
		   <c:forEach var="group" items="${grouplist}" varStatus="status"> 
		   <li style="line-height:20px;">
		   <p><a class="pic2" href="${cpath}/group_get/groupID_${group.groupID}.html"><b></b><img  src="${cpath}/${myfn:getPic(group.pic)}" width="48" height="48"   border="0"/></a>
		   </p>
		   <p><a href="${cpath}/group_get/groupID_${group.groupID}.html">${fn:substring(group.name,0,6)}(${group.joinNum})</a></p>
		   </li>
		   </c:forEach>    
           </ul>
		   <a class="create-bl-btn" href="${cpath}/group.do?action=addPage&villageID=${theForm.villageID}&firsort=1"><img src="${cpath}/images/icon_16.gif" width="135" height="30" /></a>
      </div>    
	  <div class="clearFloat"></div>
   </div>

	<div class="thebox5">
     <h3>互助机构</h3>
     <a class="more6" href="${cpath}/group.do?action=adlist&qryFirs=2">+更多</a>
      <div class="content content-sq-user">
           <ul>
			<c:forEach var="zizhu" items="${zizhulist}" varStatus="status"> 
			<li style="line-height:20px;">
			<p><a class="pic2" href="${cpath}/group_get/groupID_${zizhu.groupID}.html" target="_blank"><b></b><img   src="${cpath}/${myfn:getPic(zizhu.pic)}" width="48" height="48"  border="0" /></a>
			</p>
			<p><a href="${cpath}/group_get/groupID_${zizhu.groupID}.html" target="_blank">${fn:substring(zizhu.name,0,7)}(${zizhu.joinNum})</a></p>
			</li>
			</c:forEach>
           </ul>
      </div>
	  <div class="clearFloat"></div>
     </div>
       
	<div class="thebox10">

    </div>    
     
   </div>
   
   <div class="clearFloat"></div>
 </div> 
 <!--主体 end -->
 
 
 <!--页脚 start -->
	<%@ include file="/foot.jsp"%>
 <!--页脚 end --> 
</div>
<!--外套 end -->

</body>
</html>
<script type="text/javascript">
   /**
     * 检查项目资料维护
     */
	function addliuyan(objForm)
	{

		var userID = "${userID}";
		if(userID == '' ){
			alert('留言需要登录网站');
			window.location.href ="${cpath}/index.jsp";
			return false;
		}
		var obj	= document.getElementById(objForm);

		var ntype = obj.ntype;
		if(ntype.value == "")
  		{
			alert('类型不能为空');
			ntype.select();
			return ;
		}
		var title = obj.title;
		if(title.value == null||title.value.replace(/(^\s*)|(\s*$)/g,"").length < 1)
  		{
			alert('标题不能为空');
			title.select();
			return ;
		}
		var nsort = obj.nsort;
		if(nsort.value == "")
  		{
			alert('板块不能为空');
			nsort.select();
			return ;
		}
		var content = obj.content;
		if(content.value.replace(/(^\s*)|(\s*$)/g,"").length < 1)
		{
			alert('内容不能为空');
			return ;
		}
		if(content.value.length > 2000)
		{
			alert('内容长度不能大于2000');
			return ;
		}
		obj.submit();
	}
	function chgly(type,sort,sortid,id,tit)
	{
		var form = document.form_liuyan;
		var ntype = form['ntype'];
		var nsort = form['nsort'];
		var nsortID = form['nsortID'];
		var seqID = form['seqID'];
		var title = form['title'];
		var content = form['content'];
		
		if(seqID.value != ""){
			document.getElementById('ly' + seqID.value).style.background = "#fff";
		}
		ntype.value = type;
		nsort.value = sort;
		nsortID.value = sortid;
		seqID.value = id;
		title.value = tit;
		document.getElementById('ly' + id).style.background = "#F2F3F6";

		content.focus();
	}
</script>